def run(params:list[str]):
    from modelscope.pipelines import pipeline
    from modelscope.utils.constant import Tasks
    #pip install sentencepiece
    from modelscope.models.nlp import T5ForConditionalGeneration
    from modelscope.preprocessors import TextGenerationTransformersPreprocessor
    import sys
    from ApiBase import apiBase

    try:
        model = T5ForConditionalGeneration.from_pretrained('ClueAI/PromptCLUE-base-v1-5', revision='v0.1')
        preprocessor = TextGenerationTransformersPreprocessor(model.model_dir)
        pipeline_t2t = pipeline(task=Tasks.text2text_generation, model=model, preprocessor=preprocessor)

        #print(pipeline_t2t('为下面的文章生成摘要：\n北京时间9月5日12时52分，四川甘孜藏族自治州泸定县发生6.8级地震。'))
        # {'text': '四川甘孜发生6.8级地震'}

        cnt = apiBase.argv(1,'震发生后，领导高度重视并作出重要指示，要求把抢救生命作为首要任务，全力救援受灾群众，最大限度减少人员伤亡')
        req = apiBase.argv(2,'10个字以内的摘要')
            
        prompt = f"为下面的文章生成摘要：\n{cnt}\n要求：{req}"
        print(pipeline_t2t(prompt))
    finally:
        pipeline_t2t=None
        apiBase.close()
